package com.kaili.basic.mapper;


import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.kaili.basic.pojo.dto.WarehousingApplicationQueryDto;
import com.kaili.basic.pojo.entity.WarehousingApplication;
import com.kaili.basic.pojo.entity.WarehousingApplicationExport;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;


/**
 * Created by xxx on 18-4-25.
 */

@Mapper
public interface WarehousingApplicationMapper {
    //添加入库申请
    int addWarehousingApplication(WarehousingApplication warehousingApplication);

    //删除入库申请
    int deleteWarehousingApplication(WarehousingApplication warehousingApplication);

    //删除入库申请
    int deleteWarehousingApplications(Map<String, Object> map);

    //修改入库申请
    int updateWarehousingApplication(WarehousingApplication warehousingApplication);

    //条件查询获取入库申请信息
    List<WarehousingApplication> queryWarehousingApplication(Pagination page, WarehousingApplicationQueryDto warehousingApplicationQueryDto);

    //id查询获取入库申请详细信息
    WarehousingApplication queryWarehousingApplicationById(Long applyId);

    //订单号查询获取入库申请详细信息
    WarehousingApplication queryWarehousingApplicationByNo(String requestCode);

    //查询当前数据库中的最大id
    Long getMaxApplyId();

    //查询入库申请总退货数量
    Long getSumReturnQuantity(Long applyId);

    Long getMaxWarehousingCount();

    //查询总数量与入库数量之间相差数
    Integer getDifferQuantity(Long applyId);

    //导出
    List<WarehousingApplicationExport> queryWarehousingApplicationExport(WarehousingApplicationQueryDto warehousingApplicationQueryDto);
}
